package guoanmaker.operator.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import guoanmaker.operator.business.model.OperatorLoginAdminInformation;
import guoanmaker.operator.business.model.OperatorLoginFriendLink;
import guoanmaker.operator.business.service.OperatorLoginFriendLinkServiceInterface;
import guoanmaker.operator.helper.common.AjaxJson;
import guoanmaker.operator.helper.common.abstractobj.ApiController;
import io.swagger.annotations.ApiOperation;

@Controller
@RequestMapping(ApiController.OPERATOR_FRIENDLINK)
public class OperatorLoginFriendLinkController {
	@Autowired
	private OperatorLoginFriendLinkServiceInterface operatorLoginFriendLinkServiceInterface;
	
	@ApiOperation(value = "登录友情链接", notes = "新增/修改友情链接")
    @PostMapping(value = "saveOperatorLoginFriendLink")
    public AjaxJson saveOperatorLoginFriendLink(@RequestBody OperatorLoginFriendLink operatorLoginFriendLink) {
		AjaxJson ajaxJson=new AjaxJson();
        return ajaxJson.setSuccess(true).setStatus(200).setData(operatorLoginFriendLinkServiceInterface.saveFriendLink(operatorLoginFriendLink));
    }
	
	@ApiOperation(value = "根据Id查找友情链接", notes = "根据Id查登录友情链接")
	 @RequestMapping(value = "/getLoginFriendLinks", method = RequestMethod.POST)
	public AjaxJson getLoginFriendLinks() {
		AjaxJson ajaxJson=new AjaxJson();
	     return ajaxJson.setSuccess(true).setStatus(200).setData(operatorLoginFriendLinkServiceInterface.getFriendLinkById()
	    		 );
	 }

}
